<?php
$id				= gpc_getIntPost("id",$id);
$IsEx			= gpc_getIntPost("IsEx");
$oldModunle		= gpc_getStringPost("oldModunle");
$name	        = gpc_getStringPost("Name");
$urlstring		= gpc_getStringPost("URL",$name);
$title			= gpc_getStringPost("Title",$name);
$type 			= gpc_getStringPost("cType");
$parentcategory = gpc_getIntPost("ParentCategory");
$TopBottomOrder	= gpc_getIntPost("TopBottomOrder",-1);
$order 			= gpc_getIntPost("Order",-1);
$Status 		= gpc_getIntPost("Status");
$HasHighLine	= gpc_getBoolPost("HasHighLine",0);
$sologan 		= gpc_getStringPost("Sologan");
$description 	= gpc_getStringPost("Description");
$Intro			= gpc_getStringPost("Intro");
$Tag 			= gpc_getStringPost("Tag");

$metatitle 		= gpc_getStringPost("MetaTitle",$name);
$metakeywords 	= gpc_getStringPost("MetaKeywords");
$metadescription= gpc_getStringPost("MetaDescription",strip_tags($description));

$ImgIntro 		= gpc_getStringPost('ImgIntro');
$ImgBanner 		= gpc_getStringPost('ImgBanner');
//------==============-------------------
$urlstring      = Trim_Url($urlstring);


if(empty($name))
{
	error_transfer("Name is empty!");
}

$description = replace_pathlocal($description);
$Intro		 = replace_pathlocal($Intro);
$metadescription=strip_tags($metadescription);

//check url:
CheckUrlString($urlstring,"tbltourtype");

$order=GetOrderForInsert($TopBottomOrder,$order,-1,"tbltourtype");

if($act=="insert")
{
    InsertTourType($urlstring,$name,$description,$Intro,$metatitle,$metadescription,$metakeywords,
                    $ImgIntro,$ImgBanner,$Status,$order,$IsEx);

    Insert_Tracking("Add tour type: $name ");
    page_transfer("Add Category Success !");
}
elseif($id>0)
{
    //---------------update category--------------------------------------
    UpdateTourType($urlstring,$name,$description,$Intro,$metatitle,$metadescription,$metakeywords,
                    $ImgIntro,$ImgBanner,$Status,$order,$IsEx);

    Insert_Tracking( " Edit tour type : $name ");
    page_transfer("Update Category Success");
}
exit();
?>